project(shell)
cmake_minimum_required(VERSION 2.8)

set(CMAKE_BUILD_TYPE DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -lm")

if (USE_MYMATH)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOWN_PARSER")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOWN_PARSER")
endif (USE_MYMATH)

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -O0 -ggdb")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -mfpmath=sse -march=native -flto")

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -mfpmath=sse -march=native -flto")

aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})

